package com.owen.springboot.smartparkingms.module.app.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.owen.springboot.smartparkingms.common.model.Result;
import com.owen.springboot.smartparkingms.common.util.ShiroUtils;
import com.owen.springboot.smartparkingms.module.app.entity.Car;
import com.owen.springboot.smartparkingms.module.app.entity.CarOrder;
import com.owen.springboot.smartparkingms.module.app.entity.Park;
import com.owen.springboot.smartparkingms.module.app.mapper.CarMapper;
import com.owen.springboot.smartparkingms.module.app.service.ICarService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.owen.springboot.smartparkingms.module.sys.entity.SysUser;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Owen
 * @since 2022-02-25
 */
@Service
public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarService {

    @Resource
    CarMapper carMapper;

    @Override
    public Result listPage(Car car) {
        IPage<Car> page = new Page(car.getPageNo(),car.getPageSize());
            QueryWrapper query = new QueryWrapper();
            query.like("plate_number",car.getDescription());
        IPage<Park> list = carMapper.selectPage(page,query);
        return Result.ok(list);
    }
}
